package gui.visu.listeners;

import gui.IHM;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JDialog;

/**
 * @author Charles Perin
 * 29 mars 2011
 * LIMSI - INRIA Rennes
 * charles.perin@free.fr
 *
 */
public class ListenerCancelButton implements ActionListener{

	private JDialog parent;
	
	public ListenerCancelButton(JDialog parent){
		this.setParent(parent);
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		((IHM)parent.getParent()).setEnabled(true);
		parent.dispose();
	}

	public void setParent(JDialog parent) {
		this.parent = parent;
	}

	public JDialog getParent() {
		return parent;
	}

}
